<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of VideoCategorys
 *
 * @author ZangGuoPing
 */
class VideoCategorys extends CActiveRecord {
    public function rules() {
        return array(array('category_id,video_id', 'required'));
    }

    public function attributeLabels() {
        return array(
            'video_id' => Yii::t('default', '编号'),
            'video_name' => Yii::t('default', '视频名称'),
            'video_alias' => Yii::t('default', '视频别名'),
            'video_quality' => Yii::t('default', '视频画质')
        );
    }

    /**
     * Returns the static model of the specified AR class.
     * @return CActiveRecord the static model class
     */
    public static function model($className=__CLASS__) {
        return parent::model($className);
    }
    public function relations()
    {
        return array(
            'videoId'=> array(self::BELONGS_TO, 'video', 'video_id'),
            'category' => array(self::BELONGS_TO, 'category', 'category_id')
        );
    }
    /**
     * @return string the associated database table name
     */
    public function tableName() {
        return '{{video_categorys}}';
    }
}